new Vue({
    el: '#app',
    mixins: [Query],//组件配置文件，路径/utils/components.js
    data() {
        return {
            form: {//查询筛选
                value:'',
                value1:'',
                value2:'',
                PageNumber: 1, //页码
                RowAmount: 20,
                Condition: utf8ToBase64("%%,%%,%%"),
            },
        }
    },
    mounted() {
        /**
         * 组件配置文件中自动执行方法
         * 1.this.getColumn(); //查询表头数据
         * 2.this.getList(this.form); //查询表格数据
         * 3.this.getTreeData();//查询树
         */
    },
    methods: {
        handleSerach() { //筛选
            this.form.Condition = utf8ToBase64(`%${this.form.value}%,%${this.form.value1}%,%${this.form.value2}%`);
            this.getList(this.form);
        },
        getTreeData() {
            $.ajax({
                url: absolutepath() + 'admin/data/dtree.json',
                type: 'GET',
                success: (data) => {
                    this.treeData = data;
                },
            })
        },
        handleNodeClick(data, node) {//筛选树
            if (node.level == 1) {//省
                this.form.value2 = data.code.substring(0, 2);
            } else if (node.level == 2) {//市
                this.form.value2 = data.code.substring(0, 4);
            } else if (node.level == 3) {//区
                this.form.value2 = data.code;
            }
            this.form.Condition = utf8ToBase64(`%${this.form.value}%,%${this.form.value1}%,%${this.form.value2}%`);
            this.getList(this.form);
        },
    }
})